feat(contract): mirror OGAR APP-prefix (hi-u16) layer into ogar_codebook (closes ISS-CONTRACT-APP-PREFIX-MIRROR)#592
Conversation
…ook — closes ISS-CONTRACT-APP-PREFIX-MIRROR Membrane consumers (woa-rs / medcare-rs / smb-office-rs, BBB-barrier: contract/ontology/callcenter only) can now pull BOTH halves of a render classid from lance_graph_contract::ogar_codebook — no hand-stamped 0x000N. The #591 consumer spellbook surfaced the gap: contract::ogar_codebook mirrored the lo-u16 concept pull (canonical_concept_id) but not OGAR#97's PortSpec::APP_PREFIX / render_classid_for (the hi-u16 render composition). This closes it, following the OGAR#98 canonical_concept_name precedent. NEW (wire-compat mirror of OGAR ogar_vocab::app, no ogar-vocab dependency): - AppPrefix enum = the OGAR#95 §2 allocation table as typed data (Core 0x0000 / OpenProject 0x0001 / Odoo 0x0002 / WoA 0x0003 / SMB 0x0004 / Healthcare 0x0005 / Redmine 0x0007), with prefix() / from_prefix() / render(concept). - render_classid(prefix, concept) (mirror of app::render_classid) - render_classid_for_concept(AppPrefix, &str) (one-call membrane helper) - classid_app_prefix(classid) (mirror of app::app_of) - classid_concept(classid) (mirror of app::concept_of) Parity tests pin the wire: - app_prefixes_match_ogar_allocation_table — the 6 prefixes vs OGAR PortSpec::APP_PREFIX (drift guard). - render_classid_composes_decomposes_and_preserves_the_concept_half — the 0x0005_0901 MedCare-patient worked example, and that the render lens never perturbs the lo-u16 concept RBAC keys on. Board-hygiene (same commit): ISSUES.md ISS-CONTRACT-APP-PREFIX-MIRROR -> RESOLVED; LATEST_STATE.md Contract Inventory entry; the consumer spellbook Core-gap section -> CLOSED + remediation step 3 cites the new helper. Incidental: the crate-wide cargo fmt pass also corrected pre-existing struct-literal/line-width drift in content_store.rs (same crate, no behavior change). Verify: cargo test -p lance-graph-contract green (8 ogar_codebook unit tests + render_classid_for_concept doctest); clippy -p lance-graph-contract --all-targets -D warnings clean (default + guid-v2-tail); fmt --check clean.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a typed ChangesAppPrefix render-classid mirror
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
docs(board): record #592 merged — PR_ARC entry + LATEST_STATE status flip
…go.lock → restore q2 build parity OGAR PR #110 (2026-06-23, AuthStore class family) added 4 entries to `ogar_vocab::class_ids::ALL` (auth_store 0x0B01, auth_zitadel 0x0B02, auth_zanzibar 0x0B03, auth_ory_keto 0x0B04) and a `ConceptDomain::Auth` variant. The `lance-graph-contract::ogar_codebook` wire-compatible mirror was not updated when #110 landed — a 4-entry drift sat in main from 2026-06-23 until exposed by q2 #42's pin bump. The q2 Railway build (against the bumped `302c284` OGAR pin + latest lance-graph main) fired `lance_graph_ogar::parity::COUNT_FUSE`: `mirror::CODEBOOK.len() (39) != ogar_vocab::class_ids::ALL.len() (43)`. Three coordinated fixes: 1. lance-graph-contract: extend `ogar_codebook::CODEBOOK` with the 4 auth_* entries; add `ConceptDomain::Auth` variant; add `0x0B → Auth` to `canonical_concept_domain`; refresh the module-doc count from "two domains" → "four domains" (stale since the Health 0x09XX promotion). 2. lance-graph-ogar: `parity::domains_agree`'s `matches!()` had explicit `(O::X, C::X)` arms — needed an `(O::Auth, C::Auth)` arm. Without it, the runtime `assert_codebook_parity()` panics with "domain disagreement for auth_store (0x0b01)". 3. workspace Cargo.lock: bump pinned ogar-vocab / ogar-class-view / ogar-ontology / ogar-adapter-surrealql from `08a9c979` → `302c284` (current OGAR main, PR #110 merge). 4 references in this lock. Safe SHA swap verified: Cargo.toml deps byte-identical between commits. (The `crates/lance-graph-ogar/Cargo.lock` own-root lock is gitignored and needs the same bump locally; the workspace lock + ogar-vocab branch="main" git dep means consumer locks float to the latest commit on main — q2 already pins `302c284` which has the parity-compatible surface.) Tests: - lance-graph-contract: 9 doctests pass (compile-time fuse passes) - lance-graph-ogar lib: 53/53 pass, including `parity::tests::mirror_is_a_faithful_copy_of_ogar_codebook` - `cargo build -p lance-graph-ogar`: clean EPIPHANIES.md updated per Mandatory Board-Hygiene Rule with E-OGAR-AUTH-MIRROR-DRIFT — names the standing reminder that the mirror must be updated in the SAME commit as any OGAR-side ALL-list extension. Source-of-finding: - q2 Railway build error post-bump (the cross-pin coordination canary) - OGAR PR #110 (introduced the drift; merged 2026-06-23) - lance-graph #592 (introduced the mirror pattern; the parity guard) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Mirror OGAR #97's hi-u16 APP-prefix layer into
lance_graph_contract::ogar_codebook, so a membrane consumer (woa-rs / medcare-rs / smb-office-rs — BBB-barrier:contract/ontology/callcenteronly,lance-graph-ogarforbidden) can pull both halves of a renderclassidfrom one BBB-safe source — never hand-stamping0x000N.This closes the Core gap that #591's consumer spellbook surfaced (
ISS-CONTRACT-APP-PREFIX-MIRROR).contract::ogar_codebookalready mirrored the lo-u16 concept pull (canonical_concept_id); it now also carries the hi-u16 render composition, following the OGAR #98canonical_concept_name-mirror precedent.New surface (wire-compat mirror of OGAR
ogar_vocab::app— noogar-vocabdependency)AppPrefixenum +prefix()/from_prefix()/render(concept)PortSpec::APP_PREFIXrender_classid(prefix, concept)app::render_classidrender_classid_for_concept(AppPrefix, &str)render_classid_for::<P>classid_app_prefix(classid)app::app_ofclassid_concept(classid)app::concept_ofAllocation table (pinned):
Core 0x0000/ OpenProject0x0001/ Odoo0x0002/ WoA0x0003/ SMB0x0004/ Healthcare0x0005/ Redmine0x0007.Why this is the BBB-safe move (not a Core-First violation)
contract::ogar_codebookis the sanctioned wire-compatible mirror (zero-dep, noogar-vocablink) — the same pattern the lo-u16CODEBOOKalready uses, guarded by a drift test. This extends that mirror; it does not mint a parallel registry. The OGAR side (ogar_vocab::app, #97) stays the single source; the parity test fuses drift.Tests (parity = the drift guard)
app_prefixes_match_ogar_allocation_table— the 6 prefixes vs OGARPortSpec::APP_PREFIX.render_classid_composes_decomposes_and_preserves_the_concept_half— the0x0005_0901MedCare-patient worked example, and that the render lens never perturbs the lo-u16 concept (RBAC/ontology key on the low half).+1doctest onrender_classid_for_concept.cargo test -p lance-graph-contractgreen;clippy -p lance-graph-contract --all-targets -D warningsclean (default +guid-v2-tail);fmt --checkclean.Board-hygiene (same commit, per the mandatory rule)
ISSUES.md→ISS-CONTRACT-APP-PREFIX-MIRRORRESOLVED.LATEST_STATE.md→ Contract Inventory entry..claude/knowledge/ogar-consumer-preflight.md→ Core-gap section CLOSED; remediation step 3 cites the new helper.Incidental
The crate-wide
cargo fmtpass also corrected pre-existing struct-literal / line-width drift incontent_store.rs(same crate, no behavior change) — flagged here so it isn't a surprise in the diff.Coordination note
This is the consumer/contract half of the
ISS-CONTRACT-APP-PREFIX-MIRRORfix the parallel OGAR session offered. The remaining sibling — adding the spine-vs-membrane import-path distinction to OGAR #100's best-practices doc (§2 Pattern 1) — is OGAR-side and left to that session.🤖 Generated with Claude Code
https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests
Style